package com.ruoyi.project.emr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.emr.mapper.EmrDoctorMapper;
import com.ruoyi.project.emr.domain.EmrDoctor;
import com.ruoyi.project.emr.service.IEmrDoctorService;

/**
 * 医生Service业务层处理
 * 
 * @author gzu
 * @date 2023-07-22
 */
@Service
public class EmrDoctorServiceImpl implements IEmrDoctorService 
{
    @Autowired
    private EmrDoctorMapper emrDoctorMapper;

    /**
     * 查询医生
     * 
     * @param id 医生主键
     * @return 医生
     */
    @Override
    public EmrDoctor selectEmrDoctorById(String id)
    {
        return emrDoctorMapper.selectEmrDoctorById(id);
    }

    /**
     * 查询医生列表
     * 
     * @param emrDoctor 医生
     * @return 医生
     */
    @Override
    public List<EmrDoctor> selectEmrDoctorList(EmrDoctor emrDoctor)
    {
        return emrDoctorMapper.selectEmrDoctorList(emrDoctor);
    }

    /**
     * 新增医生
     * 
     * @param emrDoctor 医生
     * @return 结果
     */
    @Override
    public int insertEmrDoctor(EmrDoctor emrDoctor)
    {
        emrDoctor.setCreateTime(DateUtils.getNowDate());
        return emrDoctorMapper.insertEmrDoctor(emrDoctor);
    }

    /**
     * 修改医生
     * 
     * @param emrDoctor 医生
     * @return 结果
     */
    @Override
    public int updateEmrDoctor(EmrDoctor emrDoctor)
    {
        emrDoctor.setUpdateTime(DateUtils.getNowDate());
        return emrDoctorMapper.updateEmrDoctor(emrDoctor);
    }

    /**
     * 批量删除医生
     * 
     * @param ids 需要删除的医生主键
     * @return 结果
     */
    @Override
    public int deleteEmrDoctorByIds(String[] ids)
    {
        return emrDoctorMapper.deleteEmrDoctorByIds(ids);
    }

    /**
     * 删除医生信息
     * 
     * @param id 医生主键
     * @return 结果
     */
    @Override
    public int deleteEmrDoctorById(String id)
    {
        return emrDoctorMapper.deleteEmrDoctorById(id);
    }
}
